1 //Robado de http://acm.uva.es/board/viewtopic.php?f=42&t=42314&sid=0cfc4d6e55802e83ea57fed814183ab6
7 long long dp
[10][SZ
] , ret
, cnt
[SZ
];
10 //freopen("e.in" , "r" , stdin);
11 //freopen("e.out" , "w" , stdout);
12 long long n
, i
, x
, j
, sm
;
14 while(scanf("%lld" , &n
) == 1 && n
){
15 memset(cnt
, 0 , sizeof(cnt
));
19 x
= (long long)(p
*10 + .5);
23 memset(dp
, 0 , sizeof(dp
));
28 for(x
= sm
;x
>=cnt
[j
];x
--)
29 dp
[i
][x
] += dp
[i
-1][x
-cnt
[j
]];
33 ret
+= (((j
+cnt
[i
])/10)*dp
[6][j
]);
35 printf("%lld\n" , ret
);